const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const dom = new JSDOM(`<!DOCTYPE html><p>Hello world</p>`);
window = dom.window;
document = window.document;
XMLHttpRequest = window.XMLHttpRequest;


//e = {
//cityId: "25"
//mainCategoryId: 34237
//shopId: "H4ruXBnFQnDgMcXF"}

var reload = function(jv) {
//jv :https://www.dianping.com?shopId=H4ruXBnFQnDgMcXF&cityId=25&mainCategoryId=34237
        var jw;
        var jx = {};
        if (typeof jv === _$_543c[91]) {
            jx = iO.parse(jv.split(_$_543c[146])[1])
        } else {
            if (typeof jv === _$_543c[2]) {
                jx = jv
            }
        }
        ;iP.sign = iJ(jx);
        iP.cts = new Date().getTime();
        jw = iI(iP);
        if (Rohr_Opt.LogVal && typeof (window) !== _$_543c[0]) {
            window[Rohr_Opt.LogVal] = encodeURIComponent(jw)
        }
        ;return jw
}
var h = function(e) {
        var t = '//www.dianping.com'
        if (true) {
            var  n = ""
              , o = e;
            "string" == typeof o && o.startsWith("_fb_=") && (o = "");
            var r = function(t) {
                var e = [];
                for (var i in t)
                    e.push(i + "=" + t[i]);
                return e.join("&")
            }(o)
              , s = 'https' + t + "?" + r;

            try {
                n = reload(s) || ""
            } catch (t) {
                console.log("获取token失败:" + t)
            }
            return n
        }
    };


